import UIKit
import Flutter

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
    let engine = FlutterEngine(name: "hank")
    var flutter:FlutterViewController? = nil
    var msgChannel:FlutterBasicMessageChannel?=nil
    
  override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
  ) -> Bool {
    GeneratedPluginRegistrant.register(with: self)
//    NSLog('231', self);
    self.engine.run();
    self.flutter =  FlutterViewController(engine: self.engine, nibName: nil, bundle: nil)
//    self.flutter.modalPresentationStyle = 0
    self.msgChannel = FlutterBasicMessageChannel(name: "messageChannel", binaryMessenger: self.flutter as! FlutterBinaryMessenger)
    self.msgChannel?.setMessageHandler({ (call, result) in
        
    })
    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }
}
